import React from "react";
import {Message, MessageBox} from "element-react";

const socialShare = [
    {
        img: "wechat-square",
        link: null,
    },
    {
        img: "gitee",
        link: "https://gitee.com/zzyLikeJaveForever"
    },
    {
        img: "bilibili",
        link: "https://www.bilibili.com/"
    }
];

const wechatImg = `./img/header/wechat.jpg`

const onClick = () => {
    MessageBox.msgbox({
        title: '扫码添加我为好友😃',
        message: <img src={wechatImg}/>,
        showConfirmButton: false
    })
}

const Social = () => {
    return (
        <ul>
            {socialShare.map((item, i) => (
                <li key={i}>
                    <a href={item.link} target="_blank" rel="noopener noreferrer">
                        <img
                            className="svg"
                            src={`img/svg/social/${item.img}.svg`}
                            alt="brand"
                            onClick={item.img==='wechat-square'?onClick.bind(this):null}
                        />
                    </a>
                </li>
            ))}
        </ul>
    );
};

export default Social;
